﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="mfAgentDjackOrderList.aspx.cs" Inherits="msBsc.WebUi.mMall.Seller.mfAgentDjackOrderList" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>手机地接客商城</title>
    <%=getMeta()%>
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/mGlobal.css" charset="gbk" />
    <link rel="stylesheet" type="text/css" href="/themes/mStyle1/css/home/base.css" charset="gbk" />
    <link href="/jqPlugin/laydate/skins/default/laydate.css" rel="stylesheet" charset="gbk" />
    <link href="/themes/mStyle1/css/public/mOrder.css" rel="stylesheet" />
    <%=getBodyBeforeJs()%>

    <script type="text/javascript" src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jBase.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/jmPage.js"></script>
    <script type="text/javascript" src="/themes/Style1/jsQt.js"></script>
    <script type="text/javascript" src="/jqPlugin/js/laytpl.js"></script>
    <script type="text/javascript" src="/themes/wStyle1/js/comm/VerifyJs.js"></script>
    <script type="themes/wStyle1/js/comm/DateInfo.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
        });
        //        $(window).bind('resize', function () { _self._ResizeHandler(_self); })
        //        .bind('scroll', function () { _self._ResizeHandler(_self); });
    </script>
    <!--head fix rgn-->
    <style type="text/css">
        .c_order {
            margin-top: 0px;
        }

        .menu_order {
            display: table;
            width: 100%;
            color: #999;
            text-align: center;
            line-height: 36px;
        }

            .menu_order .menu_order_cell {
                display: table-cell;
            }

                .menu_order .menu_order_cell a {
                    font-family: 微软雅黑;
                    cursor: pointer;
                    font-size: 18px;
                }

                .menu_order .menu_order_cell .checkMenu {
                    color: #666;
                }

        .pager {
            display: block;
            height: 50px;
            margin-bottom: 20px;
        }

            .pager a {
                background-color: #fff;
                border: 1px solid #bfc2c3;
                color: #3c3c3c;
                display: block;
                height: 50px;
                line-height: 50px;
                outline: medium none;
                position: absolute;
                text-align: center;
                text-decoration: none;
                width: 100%;
            }
    </style>
    <base target="_self" />
</head>
<body>
    <div class="viewport">
        <%=msBsc.WebUi.Code.QtHtmlGet.GetWapHeaderMenuHtml(true) %>
        <form action='#' method="post" id="J_EmailForm">
            <input type="hidden" id="orderStatus" value="0" />
            <input type="hidden" id="pageIndex" value="" />
            <div class="c_order">
                <div class="menu_order">
                    <div class="menu_order_cell"><a data-value="0" class="menu_order_info checkMenu">全部</a></div>
                    <div class="menu_order_cell"><a data-value="1" class="menu_order_info">已付款</a></div>
                    <div class="menu_order_cell"><a data-value="2" class="menu_order_info">已完成</a></div>
                    <div class="menu_order_cell"><a data-value="3" class="menu_order_info">已结算</a></div>
                    <div class="menu_order_cell"><a data-value="4" class="menu_order_info">已退款</a></div>
                </div>
                <div id="order_list">
                </div>
                <%--<div>
                    <div class="pager" style="display: none">
                        <a href="###" id="pageNextText">查询更多</a>
                    </div>
                </div>--%>
            </div>


            <xmp id="svc_list_temp_order" style="display: none">
             {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
             <div class="order_info_list">
                        <div class="order_comm">
                            <div class="fl_order_comm order_list_number"><span>订单号：</span><span>{{d.rows[i].ORDER_CODE}}</span></div>
                            <div class="fr_order_comm order_list_number order_stime">
                                <div>
                                    <span>下单时间：</span>
                                    <span>{{formatDate1(new Date(d.rows[i].ORDER_TIME))}}</span>
                                </div>
                            </div>
                        </div>
                        <div class="order_comm">
                            <div class="l_order_user">
                                <a class="l_order_user_href">
                                    getNick({{d.rows[i].TOURIST_NAME,TOURIST_GENDER}})
                                    </a>
                            </div>
                            <div class="r_order_user">
                                <a class="r_order_user_href">{{d.rows[i].TOURIST_PHONE}}</a>
                            </div>
                            <div class="div_order_status">
                                <div class="order_money">订单金额￥{{getNumber(d.rows[i].ORDER_TOTAL_FEE)}}</div>
                                <div class="order_money">定金金额￥{{getNumber(d.rows[i].ORDER_DEPOSIT)}}</div>
                                <div class="order_status">
                                    {{#if(d.rows[i].ORDER_STATUS==1){ }}
                                    已付款
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==2){ }}
                                    已完成
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==3){ }}
                                    已结算
                                    {{#} }}
                                    {{#if(d.rows[i].ORDER_STATUS==4){ }}
                                    已退款
                                    {{#} }}
                                </div>
                            </div>
                        </div>
                        <div class="order_operating">
                            <div class="operatInfo">服务时间:{{formatDate1(new Date(d.rows[i].ORDER_START_TIME))}} - {{formatDate1(new Date(d.rows[i].ORDER_STOP_TIME))}}</div>
                        </div>
                    </div>
                <div class="excision"></div>
                                
            {{#} }}
                           </xmp>

        </form>
        <script type="text/javascript" src="/jqPlugin/laydate/laydate.js" charset="gbk"></script>
        <script src="/themes/wStyle1/js/comm/DateInfo.js"></script>
        <script type="text/javascript">

            //获取游客 昵称
            function getNick(name, gender) {
                var nick = name.toString();
                if (nick.length > 5) {
                    nick = gender == "F" ? nick.substring(0, 1) + "先生" : nick.substring(0, 1) + "女士";
                }
                return nick;
            }

            (function () {
                $("#h_title").text("我的订单");
                $.getMessageCount();
                $("#orderStatus").val(0);
                $("#pageIndex").val(1);
                $(".menu_order_info").click(function () {
                    if (!$(this).hasClass("checkMenu")) {
                        $(".menu_order_info").removeClass("checkMenu");
                        $(this).addClass("checkMenu");
                        $("#orderStatus").val($(this).attr("data-value"));
                        $('#order_list').html("");
                        btnDo(1);
                    }
                });
                //点击更多
                $("#pageNextText").live("click", function () {
                    nextPage();
                });
            })()

            function btnDo(pIndex) {
                var opart = new jsonRow();
                opart.AddCell("ACTION", "getOrderList");
                opart.AddCell("orderStatus", $("#orderStatus").val());
                opart.AddCell("pageRows", 10);
                opart.AddCell("pageNum", pIndex);
                ajaxComm(opart);
            }
            btnDo(1);
            function setOrderList(data) {
                if (IsNull(data) || IsNull(data.rows)) {
                    return;
                }
                var _html = $("#svc_list_temp_order").html();

                laytpl(_html).render(data, function (render) {
                    $('#order_list').html(render);
                });
                showNextPage(data.rows[0].DATACOUNT);
            }

            //是否显示更多
            function showNextPage(dataCount) {
                var pIndex = $("#pageIndex").val();
                if (IsNull(pIndex)) {
                    pIndex = 1;
                }
                var pageIndex = parseInt(pIndex);
                var count = parseInt(dataCount);
                if (pageIndex * 10 < count) {
                    $(".pager").show();
                } else {
                    $(".pager").hide();
                }
            }

            //更多
            function nextPage() {
                var pIndex = $("#pageIndex").val();
                if (IsNull(pIndex) || isNaN(pIndex)) {
                    pIndex = 1;
                }
                var pageIndex = parseInt(pIndex) + 1;
                $("#pageIndex").val(pageIndex);
                btnDo(pageIndex);
            }
        </script>
    </div>
</body>
<%=getBodyAfterJs() %>
</html>

